package hn.cch.redis_token.controller;


import hn.cch.redis_token.annotation.TokenAnnotation;
import hn.cch.redis_token.message.TokenRequest;
import hn.cch.redis_token.message.TokenResponse;
import hn.cch.redis_token.service.RedisService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 首页接口：使用token
 */

@Api(tags = "首页接口")
@Controller
public class IndexController {

    private static Logger logger = LoggerFactory.getLogger(IndexController.class);


    @ApiOperation(value = "客户端使用token",notes = "服务端从redis中取出token",httpMethod = "POST")
    @PostMapping(value = "/index")
    @TokenAnnotation
    // public @ResponseBody TokenResponse index(@RequestBody TokenRequest tokenRequest){
    public @ResponseBody TokenResponse index(){
        return TokenResponse.success();
    }


}
